import request from '../utils/request.js'
import store from '../store/index.js'

export function addMoment(moment) {
  return request({
    url: '/moment/addMoment',
    method: 'post',
    data: {
      momentUserId: store.getters.userId,
      momentContent: moment.momentContent,
      momentContentImg: moment.momentContentImg,
      momentStatus: 1
    }
  })
}

export function getMomentById(momentId) {
  return request({
    url: '/moment/getMomentByMomentId/' + momentId,
    method: 'get'
  })
}

export function getMoment() {
  return request({
    url: '/moment/findAll',
    method: 'get'
  })
}

export function updateMoment(momentId) {
  return request({
    url: '/moment/UpDateMomentStatusByMomentId/' + momentId,
    method: 'post'
  })
}

export function deleteMoment(momentId) {
  return request({
    url: 'moment/deleteMomentByMomentId/' + momentId,
    method: 'post'
  })
}
